﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Vortex.Drawing {

	/// <summary>
	/// Represents Vortex2D drawing device with single drawing context support. Such kind of device can be run fullscreen and also vertical synchronization can be adjusted
	/// </summary>
	public class SingleContextDevice : DrawingDevice {

		/// <summary>
		/// Initializes a new instance of the <see cref="SingleContextDevice"/> class.
		/// </summary>
		/// <param name="targetWindow">The target window.</param>
		public SingleContextDevice(IntPtr targetWindow)
			: base(targetWindow, 0, 0, false, false) {
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="SingleContextDevice"/> class.
		/// </summary>
		/// <param name="targetWindow">The target window.</param>
		/// <param name="bufferWidth">Width of the buffer.</param>
		/// <param name="bufferHeight">Height of the buffer.</param>
		public SingleContextDevice(IntPtr targetWindow, int bufferWidth, int bufferHeight)
			: base(targetWindow, bufferWidth, bufferHeight, false, false) {
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="SingleContextDevice"/> class.
		/// </summary>
		/// <param name="targetWindow">The target window.</param>
		/// <param name="fullscreen">if set to <c>true</c> to startup with fullscreen.</param>
		/// <param name="verticalSync">if set to <c>true</c> to startup with vertical sync.</param>
		public SingleContextDevice(IntPtr targetWindow, bool fullscreen, bool verticalSync)
			: base(targetWindow, 0, 0, fullscreen, verticalSync) {
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="SingleContextDevice"/> class.
		/// </summary>
		/// <param name="targetWindow">The target window.</param>
		/// <param name="bufferWidth">Width of the buffer.</param>
		/// <param name="bufferHeight">Height of the buffer.</param>
		/// <param name="fullscreen">if set to <c>true</c> to startup with fullscreen.</param>
		/// <param name="verticalSync">if set to <c>true</c> to startup with vertical sync.</param>
		public SingleContextDevice(IntPtr targetWindow, int bufferWidth, int bufferHeight, bool fullscreen, bool verticalSync)
			: base(targetWindow, bufferWidth, bufferHeight, fullscreen, verticalSync) {
		}

		///<summary>
		///Single drawing context of this device
		///</summary>
		public PrimaryDrawingContext Context {
			get { return _primaryDrawingContext; }
		}
	}
}
